Skip to content

Conversation

@yossi2le
Copy link
Owner

Description

The function _get_blockdevice_FLASHIAP in kv_config.cpp has been refactored into 3 function. the first function will calculate the default start address and size for internal TDBStore in case of rbp when KVStore is configured as TDB_EXTERNAL or FILESYSTEM. a second function will calculate the default start address and size for the case we run in TDB_INTERNAL. and the last is _get_blockdevice_FLASHIAP which will check the validity of parameters and create the block device.

Also, lots of remarks have been added to the code in order to simplify the understanding of the complex configuration code.

Last thing, the parameter of rbp_num_of_enteries has been remove from TDB_EXTERNAl and FILESYSTEM configuration files.

Pull request type

[ ] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[x] Breaking change

Reviewers

@dannybenor , @davidsaada , @theamirocohen and @offirko
Please review. I will create a real PR after your review.

Copy link
Collaborator

@davidsaada davidsaada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, excluding some minor English fixes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you already changed it, please change to "Default is the size of the 2 last sectors of internal flash".

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"There are less than two sectors - TDBStore will not work."

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here - "Default is the size of the 2 last sectors of internal flash".

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@yossi2le yossi2le force-pushed the yossi_remove_num_entreies branch from eb91169 to 8991abb Compare January 2, 2019 11:23
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think size can be 0 here because its Non default configuration and here start_address==0, so size must be different.
If for any reason size is 0 , then when you calculate above:
start_address = flash_end_address - size;
aligned_start_address = align_down(start_address, flash.get_sector_size(start_address));

start_address will become flash_end_address and then
I think it should be flash.get_sector_size(start_address-1)

…efault values are use

remove of rbp_number_of_entries from the kvstore configuration. Adding default option for storage_type
allowing the system to choose TDB_INTERNAl, TDB_EXTERNAL or FILESYSTEM base on the blockdevice component
set in the target board. Adding remarks to kv_config.cpp and break simplify the _get_blockdevice_FLASHIAP function
@yossi2le yossi2le force-pushed the yossi_remove_num_entreies branch from 03d6f3d to 388da7f Compare January 3, 2019 12:03
@yossi2le yossi2le closed this Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants